class TripwireHookRenderer : public IBlockRenderer
{
public:
	ITexture *Texture;

	TripwireHookRenderer(ITexture *texture) :
		Texture(texture)
	{
	}

	int GetTypeData(const int &data) { return data; }

	void Render(Schematic *schematic, RendererBase *renderer, const Block &block, const Point3i &position)
	{
		byte dir = (byte)(block.Data & ~(0x08 | 0x04));
		bool middle = (block.Data & 0x04) != 0;
		bool end = (block.Data & 0x08) != 0;

		renderer->Translate(8, 8, 8);
		renderer->Rotate(dir * -90, 0, 1, 0);
		renderer->Translate(-8, -8, -8);

		renderer->Draw(Box(Texture, Point3i(4, 8, 2), Point3i(6, 7, 0)).SetCoordsFromBounds(Point2i(4 * 16, 0)));

		renderer->Translate(0, 8, 0);
		if (end)
			renderer->Rotate(-5, 1, 0, 0);
		else if (!middle)
			renderer->Rotate(35, 1, 0, 0);
		renderer->Translate(0, -8, 0);

		renderer->PushState();
		renderer->Translate(12, 10, 4);
		renderer->Rotate(-90, 1, 0, 0);
		renderer->Translate(-12, -10, -4);

		renderer->Draw(Box(Texture, Point3i(2, 7, 2), Point3i(7, 7, 4)).SetAll(Point2i(Point2i(12 * 16 + 7, 10 * 16 + 9))));
		renderer->PopState();
		
		renderer->PushState();
		renderer->Translate(8, 8, 8);
		renderer->Scale(0.5f, 0.5f, 0.5f);
		renderer->Translate(-8, -8, -8);

		renderer->Draw(Box(Texture, Point3i(6, 2, 6), Point3i(5, 13, 5)).SetAll(Point2i(Point2i(12 * 16 + 5, 10 * 16 + 3))));
		renderer->PopState();
	}
};